Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: stop running hl when compiling to hlc on arm64 #11783

Conversation

TheArktect
Copy link

I was fiddling with Haxe/HashLink in my M1 Macbook, and when compiling HashLink from source this message was displayed:

Makefile:174: HashLink vm is not supported on arm64, skipping

I already knew that HashLink didn't have arm64 JIT and only supported hlc compilation, but when compiling on arm64 with this command:

haxe --main Main --hl out/main.c

An error message is displayed although valid C code is generated without any problems:

Error: Library hashlink is not installed
 ERROR  (unknown position)

   | Error: Build failed

It seems counterintuitive to run the hl binary when the architecture doesn't support it. I know if I supply -D no-compilation=true this won't be shown, as the Haxe compiler doesn't try to run haxelib run hashlink (this happens on file src/generators/genhl.ml around line 4305), but again, it seems counterintuitive.

This fix simply checks if we are on arm64 and sets the define flag NoCompilation accordingly. If this fix is not desirable, please let me know so that I can proceed and maybe document the use of the no-compilation flag on the HashLink section of the Haxe manual. Thank you for the amazing language!

@tobil4sk
Copy link
Member

tobil4sk commented Oct 5, 2024

An error message is displayed although valid C code is generated without any problems:

It seems counterintuitive to run the hl binary when the architecture doesn't support it.

This is not the problem that's happening here. The missing hashlink error here is not related to the missing hl binary. It is related to the support library for hashlink compilation. See the manual on how to install the hashlink haxelib: https://haxe.org/manual/target-hl-getting-started.html#prerequisites

If you install that, then it will fix this error even if hl is not present.

@TheArktect
Copy link
Author

I've probably missed this installation step in this computer, it does run properly now, thanks! I'll be closing the pull request.

@TheArktect TheArktect closed this Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants